'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  // 测试pages
  router.get('/', app.middleware.loginChecks.loginRedirect, controller.home.index);
  router.get('/profile/:userName', app.middleware.loginChecks.loginCheck, controller.home.profilePage);
  router.get('/loadMore/:userName/:pageIndex', controller.home.loadMore);

  require('./routes/pages/user')(app);
  require('./routes/api/user')(app);

  // 404
  router.get('*', controller.home.notFound);
};

